<?php

/**
 * Created
 * User: zuoa
 * Date: 2016/11/21 0021
 * Time: 19:35
 */
class Violationsearch extends Y_Controller
{
    public function __construct()
    {
        parent::__construct();
        $this->load->helper('file');
    }
    public function index(){
        $this->check_login();
        $per_page_num = 20;
        $config['base_url'] = '/wzjy/violationsearch';
        $config['per_page'] = $per_page_num;
        $config['full_tag_open'] = '<ul class="pagination pagination-sm">';
        $config['full_tag_close'] = '</ul>';

        $config['anchor_class'] = "";

        $config['cur_tag_open'] = '<li class="active"><a>';
        $config['cur_tag_close'] = '</a></li>';

        $config['num_tag_open'] = '<li>';
        $config['num_tag_close'] = '</li>';

        $config['prev_tag_open'] = '<li>';
        $config['prev_tag_close'] = '</li>';

        $config['next_tag_open'] = '<li>';
        $config['next_tag_close'] = '</li>';

        $config['first_link'] = '首页';
        $config['first_tag_open'] = '<li>';
        $config['first_tag_close'] = '</li>';

        $config['last_link'] = '尾页';
        $config['last_tag_open'] = '<li>';
        $config['last_tag_close'] = '</li>';

        $config['prev_link'] = '上一页';
        $config['next_link'] = '下一页';

        $config['use_page_numbers'] = TRUE;
        $config['reuse_query_string'] = TRUE;
        $config['total_rows'] = $this->detail_model->get_count($xmmc, $zlmc, $clmc);
        $this->pagination->initialize($config);
        $data["pagination"] = $this->pagination->create_links();


        $details = $this->detail_model->get_list($xmmc, $zlmc, $clmc,$sszd,($page - 1) * 20, 20);
        $data['details'] = $details;

        $violation = $this->violation_model->get_list();
        $data['violation'] = $violation;

        $this->load->view('dashboard/header', $this->_get_context());
        $this->load->view('dashboard/wzjy/violationsearch', $data);
        $this->load->view('dashboard/footer');
    }

}